package ${basePackage}.model;

import lombok.Data;

/**
 * @author ${author}
 * @version ${version}
 * @description TODO
 * @date 2024/7/23 14:23
 */

<#macro generatorModel modelInfo indent>
<#if modelInfo.description??>
${indent}/**
${indent}*${modelInfo.description}
${indent}*/
</#if>
${indent}public ${modelInfo.type} ${modelInfo.fieldName} <#if modelInfo.defaultValue??> = ${modelInfo.defaultValue?c}</#if>;
</#macro>

@Data
public class DataModel {

<#list modelConfig.models as modelInfo>
    <#if modelInfo.groupKey??>
     /**
      *${modelInfo.groupName}
      */
      public ${modelInfo.type} ${modelInfo.groupKey} = new ${modelInfo.type}();

    /**
    *${modelInfo.groupName}
    */
     @Data
     public static class ${modelInfo.type}{
        <#list modelInfo.models as modelInfo>
     <@generatorModel indent="        " modelInfo=modelInfo />
        </#list>
     }
        <#else>
     <@generatorModel indent="        " modelInfo=modelInfo />
    </#if>

</#list>
}